<template>
  <!-- api日志-->

  <div class="row-main">
    <el-button type="shenda" size="mini" icon="el-icon-back" @click="back">返回</el-button>
    <el-table :data="tableData" :header-cell-style="{ 'background':$store.state.app.tableBgColor,'color':'#606266' }" class="row-main-table">
      <el-table-column prop="cardNumber" label="卡号" :fixed="$store.state.app.screenWidth<810?true:false" :width="$store.state.app.screenWidth<810?'150px':'auto'" align="center"></el-table-column>
      <el-table-column prop="setMealName" label="套餐名字" :width="$store.state.app.screenWidth<750?'150px':'auto'" align="center"></el-table-column>
      <el-table-column prop="dictStatusName" label="状态" :width="$store.state.app.screenWidth<750?'150px':'auto'" align="center"></el-table-column>
      <el-table-column prop="remark" label="备注" :width="$store.state.app.screenWidth<750?'180px':'auto'" align="center"></el-table-column>
      <el-table-column prop="insertTimeTime" label="操作时间" :width="$store.state.app.screenWidth<750?'180px':'auto'" align="center"></el-table-column>
    </el-table>
    <div :style="{'overflow-x': $store.state.app.screenWidth<992?'scroll':'none'}">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        class="row-main-pager"
        :current-page.sync="page.current"
        :page-size="page.size"
        :total="page.total"
        layout="total, sizes, prev, pager, next, jumper"
        background></el-pagination>
    </div>
  </div>


</template>
<script>
import {batchRechargeDetailList} from '@/api/getData'

export default {
  name: "oemTransOrder",
  data() {
    return {
      loading: false,
      tableData: [],
      id: '',
      page: {
        current: 1,
        size: 10,
        total: 0
      }
    }
  },
  created() {
    this.findList()
  },
  methods: {
    findList() {
      this.id = this.$route.query.id;
      if (this.id == null || this.id == '') {
        this.$router.push({path: ''})
        return
      }

      batchRechargeDetailList({page: this.page, cusBatchRechargeOrderId: this.id}).then(response => {
        this.tableData = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }).catch(e => {
        this.loading = false
      })
    },
    handleSizeChange(pageSize) {
      this.page.current = 1;
      this.page.size = pageSize;
      this.findList();
    },
    handleCurrentChange(val){
      this.page.current = val;
      this.findList();
    },
    beforeinitData() {
      this.page.current = 1
      this.findList()
    },
    back() {
      this.$router.go(-1)
    }

  }
}
</script>

<style scoped>

</style>
